package com.plugin.core.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 老人信息实体类
 * 
 * @author mark
 * @date 2025-07-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("elder_info")
@Schema(name = "ElderInfo", description = "老人信息表")
public class ElderInfo {

    @Schema(description = "ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "app_user表的id")
    @TableField("elder_id")
    private Long elderId;

    @Schema(description = "房间id")
    @TableField("room_id")
    private Integer roomId;

    @Schema(description = "照片(存链接按逗号分隔)")
    @TableField("photo")
    private String photo;

    @Schema(description = "真实姓名")
    @TableField("realname")
    private String realname;

    @Schema(description = "年龄")
    @TableField("age")
    private Integer age;

    @Schema(description = "手机号")
    @TableField("mobile_phone")
    private String mobilePhone;

    @Schema(description = "性别(1男2女;0未知)")
    @TableField("sex")
    private Integer sex;

    @Schema(description = "身份证")
    @TableField("id_card")
    private String idCard;

    @Schema(description = "生日如1988-10-23")
    @TableField("birthday")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate birthday;

    @Schema(description = "省")
    @TableField("province")
    private String province;

    @Schema(description = "市")
    @TableField("town")
    private String town;

    @Schema(description = "区")
    @TableField("area")
    private String area;

    @Schema(description = "社区")
    @TableField("community")
    private String community;

    @Schema(description = "户籍地址")
    @TableField("domicile_address")
    private String domicileAddress;

    @Schema(description = "现居详细地址")
    @TableField("detailed_address")
    private String detailedAddress;

    @Schema(description = "民族")
    @TableField("nation")
    private String nation;

    @Schema(description = "文化程度")
    @TableField("education_level")
    private String educationLevel;

    @Schema(description = "婚姻状况")
    @TableField("marital_status")
    private String maritalStatus;

    @Schema(description = "紧急联系人姓名")
    @TableField("emgency_name")
    private String emgencyName;

    @Schema(description = "紧急联系人性别")
    @TableField("emgency_sex")
    private Integer emgencySex;

    @Schema(description = "紧急联系人电话")
    @TableField("emgency_phone")
    private String emgencyPhone;

    @Schema(description = "关系")
    @TableField("relation")
    private String relation;

    @Schema(description = "工作单位")
    @TableField("work_unit")
    private String workUnit;

    // ========== 健康信息相关字段 (原elder_health_info表字段) ==========

    @Schema(description = "血型")
    @TableField("blood_type")
    private Integer bloodType;

    @Schema(description = "健康状况")
    @TableField("health_detail")
    private String healthDetail;

    @Schema(description = "健康标签")
    @TableField("health_label")
    private String healthLabel;

    @Schema(description = "生活能力")
    @TableField("action_capability")
    private String actionCapability;

    @Schema(description = "自理能力")
    @TableField("self_care_ability")
    private Integer selfCareAbility;

    @Schema(description = "护理等级")
    @TableField("care_level")
    private Integer careLevel;

    @Schema(description = "睡眠质量")
    @TableField("sleep_quality")
    private String sleepQuality;

    @Schema(description = "吸烟频率")
    @TableField("smoking_frequency")
    private String smokingFrequency;

    @Schema(description = "饮酒频率")
    @TableField("drinking_frequency")
    private String drinkingFrequency;

    @Schema(description = "运动频率")
    @TableField("exercise_frequency")
    private String exerciseFrequency;

    @Schema(description = "饮食偏好")
    @TableField("food_preference")
    private String foodPreference;

    @Schema(description = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdTime;

    @Schema(description = "修改时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updatedTime;

    @Schema(description = "注销时间")
    @TableField("cancel_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime cancelTime;

    @Schema(description = "删除(0不删除1已删除)一般为0能用1不能用")
    @TableField("del")
    private Integer del;
}
